<%@page language="java" contentType="text/html;charset=utf-8" pageEncoding="utf-8" isELIgnored="false"%>
<%@taglib uri="http://struts.apache.org/tags-logic" prefix="logic" %>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<style type="text/css">
.inner_body_left {
    background-image: url("/style/images/bloglist.jpg");
    background-repeat: no-repeat;
    padding-top: 80px;
}
.body_left a {
}
.article {
	margin: 20px 30px 0px 30px;
	padding: 0;
}
.article .title {
	text-align: left;
	font-weight: bold;
	font-size: 15px;
}
.article .title a:link {
    color: #998f66;
}
.article .dateline {
	text-align: center;
	font-size: 11px;
	margin-top: 5px;
	margin-bottom: 5px;
}
.article .content {
    margin-bottom: 10px;
    line-height: 24px;
    font-size: 14px;
}
.article .oper {
	text-align: center;
}
.article .line {
	margin-top:17px;
	line-height:17px;
	border-top:1px solid #CCCCBC
}
.body_right .category {
}
#oper {
	position: absolute;
	top: 50px;
	right: 20px;
}
.page_button {
    cursor: hand;
    float: left;
    width: 25px;
    height: 25px;
    border: solid gray 1px;
    text-align: center;
    background-color: gray;
}
.page_button_cur {
    cursor: hand;
    float: left;
    width: 25px;
    height: 25px;
    border: solid gray 1px;
    text-align: center;
}
</style>

<!-- <div class="body_left">-->
<c:if test="${login}">
    <span id="oper"><a href="/create/article" >写新文章</a></span>
</c:if>

<c:forEach items="${articles}" var="article">
	<div class="article">
		<div class="title"><a href="/articleDetail.do?aid=${article.id }">${article.title }</a></div>
		<div class="dateline"><fmt:formatDate value="${article.dateline }" pattern="yyyy-MM-dd HH:mm"/></div>
		<div class="content">${article.description }</div>
		<p align="left"><a href="/articleDetail.do?aid=${article.id }">阅读全文&gt;&gt;</a></p>
		<div class="oper"><a href="/articleDetail.do?aid=${article.id}#comment">评论(${article.messageCount})</a> | <a href="/articleDetail.do?aid=${article.id}#comment">浏览(${article.browseCount})</a> <c:if test="${login}"> | <a href="/editArticle.do?aid=${article.id }">编辑</a> | <a href="/deleteArticle.do?aid=${article.id}">删除</a></c:if></div>
		<div class="line"></div>
	</div>
</c:forEach>
<div class="page">
    <div class="page_button">&lt;&lt;</div>
    <div class="page_button">&lt;</div>
    <c:forEach begin="1" end="${pageInfo.totalPages}" varStatus="vs">
        <c:if test="${pageInfo.localPageNo eq vs.index}">
            <div class="page_button_cur" onclick="window.location.href='<c:url value="/index.do?pageNo=${vs.index}"/>'">${vs.index}</div>
        </c:if>
        <c:if test="${not (pageInfo.localPageNo eq vs.index)}">
            <div class="page_button" onclick="window.location.href='<c:url value="/index.do?pageNo=${vs.index}"/>'">${vs.index}</div>
        </c:if>
    </c:forEach>
    <div class="page_button">&gt;</div>
    <div class="page_button">&gt;&gt;</div>
</div>
